/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package src.services.loan;

/**
 *
 * @author jay
 */

import java.util.List;
import java.util.Map;
import javax.faces.model.SelectItem;
import src.domain.loan.Collateral;
import src.services.CRUEDService;

public class CollateralModel implements java.io.Serializable {
    
    private CRUEDService service;
    
    public CollateralModel() {
        service = new CRUEDService();
    }
    
    public List<Collateral> findAll(Map<String, String> filters) {
        return (List<Collateral>) service.findAll("Collateral", filters);
    }
   
    public Map<Integer, String> mapAll() {
        return service.mapAll("Collateral", "collateralId", "collateralName");
    }
    
    public List<SelectItem> listAll() {
        return service.listAll("Collateral", "collateralId", "collateralName");
    }
    
    public Collateral getById(Integer id) {
        return (Collateral)  service.getById(Collateral.class, id);
    }
    
    public boolean saveData(Collateral data) {
        return service.saveData(data);
    }
    
    public boolean deleteData(Collateral data) {
        return service.deleteData(data);
    }
}
